﻿/*!
          .----.
       _.'__    `.
   .--($)($$)---/#\
 .' @          /###\
 :         ,   #####
  `-..__.-' _.-\###/
        `;_:    `"'
      .'"""""`.
     /,  ya ,\\
    //  FYZ!  \\
    `-._______.-'
    ___`. | .'___
   (______|______)
  
 * fyz v fyz.js
 * 轻松解决网站大部分特效展示问题
 * Copyright 2017, 付永周
 * 请尊重原创，保留头部版权
 * 本插件基于 jquery-1.8.3.min.js 低版本或者高版本会有兼容问题
 * 本插件适用于 ie8及ie8以上的浏览器
 * v1.1.0：增加十个基础效果
 * v1.1.1：增加一个横向手风琴效果
 * v1.1.4：对v1.1.3做升级
 */
(function($){
	$.fn.extend({
		'InfiniterScroll':function(options){
			var opts = $.extend({},InfiniterScroll_Defaluts,options);
			var $this = $(this);
			var $thisAll = $this.find('*');
			opts.liWidth = $this.find('li.con').outerWidth(true);
			opts.liSize = $this.find('li.con').size();
			if(opts.liSize>opts.showSum){
				function autoPlay(){
					clearInterval(opts.timer);
					opts.timer = setInterval(function(){
						opts.click ++;
						if(opts.click < opts.liWidth){
							opts.left = -opts.click + 'px';$($this).css('left',opts.left);
						}else{
							opts.ulLi = $($this).find('li.con').eq(0);
							$($this).append(opts.ulLi);
							$($this).css('left','0px');
							opts.click = 0;
						};
				},opts.IntervalTime);};
				autoPlay();
				function clearIntervalFun(clearIntervalObj){
					$(clearIntervalObj).bind('mouseover',function(){clearInterval(opts.timer);});
					$(clearIntervalObj).bind('mouseout',function(){autoPlay();});
				};
				clearIntervalFun($this);
				clearIntervalFun($thisAll);
			};
		},
		'bannerChange':function(options){
			var opts = $.extend({},bannerChange_Defaluts,options);
			var $this = $(this);
			var $thisAll = $this.parent().find('*');
			opts.liSize = $this.find('li.con').size();
			$this.find('li.con:first').show();
			for(var i=0; i<opts.liSize; i++){opts.Str += '<li></li>';};
			$(opts.ulBannerBut).html(opts.Str);
			$(opts.ulBannerBut).find('li').eq(0).addClass(opts.bannerButHover);
			$(opts.ulBannerBut).find('li').live('click',function(){
				opts.index = $(this).index();
				partCom();
			});			
			function partCom(){
				$(opts.ulBannerBut).find('li').eq(opts.index).addClass(opts.bannerButHover).siblings('li').removeClass(opts.bannerButHover);
				$this.find('li.con').eq(opts.index).fadeIn(2000).siblings('li').fadeOut(2000);
			};
			if(opts.autoPlay){
				function autoPlay(){
					clearInterval(opts.timer);
					opts.timer = setInterval(function(){
						opts.index++;
						opts.index = opts.index%opts.liSize;
						partCom();
					},opts.setInterValTime);
				};
				autoPlay();
				function clearIntervalFun(clearIntervalObj){
					$(clearIntervalObj).bind('mouseover',function(){clearInterval(opts.timer);});
					$(clearIntervalObj).bind('mouseout',function(){autoPlay();});
				};
				clearIntervalFun($this);
				clearIntervalFun($thisAll);
			};
			if(opts.ifLeftRightClick){
				$(opts.butRight).show();
				$(opts.butLeft).show();
				$(opts.butRight).bind('click',function(){
					opts.index++;
					opts.index = opts.index%opts.liSize;
					partCom();
				});
				$(opts.butLeft).bind('click',function(){
					opts.index--;
					if(opts.index == -1){opts.index = opts.liSize-1};
					partCom();
				});
			};
		},
		'singleLeftRightChange':function(options){
			var opts = $.extend({},singleLeftRightChange_defaluts,options);
			var $this  = $(this);
			var $thisAll = $this.find('*');			
			opts.rightOneDate = new Date();			
			opts.rightoneTime = opts.rightOneDate.getTime();
			opts.leftOneDate = new Date();
			opts.leftoneTime = opts.leftOneDate.getTime();
			opts.liSize = $this.find('li.con').size();
			opts.liWidth = $this.find('li.con').outerWidth(true);
			if(opts.liSize > opts.showsum){
				$(opts.rightBut).live('click',function(){
					opts.rightTwoDate = new Date();
					opts.rightTwoTime = opts.rightTwoDate.getTime();
					opts.RightAfterBeforTime = opts.rightTwoTime - opts.rightoneTime;
					if(opts.RightAfterBeforTime >= opts.animateTime){partCom();};
					opts.rightoneTime = opts.rightTwoTime;
				});
				$(opts.leftBut).live('click',function(){
					opts.leftTwoDate = new Date();
					opts.leftTwoTime = opts.leftTwoDate.getTime();
					opts.leftAfterBeforTime = opts.leftTwoTime - opts.leftoneTime;
					if(opts.leftAfterBeforTime >= opts.animateTime){
						opts.liLastChild = $this.find('li.con').eq(opts.liSize - 1);
						$this.prepend(opts.liLastChild);
						$this.find('li.con').eq(0).css('margin-left','-'+opts.liWidth+'px');
						$this.find('li.con').eq(0).stop(true,true).animate({'margin-left':'0px'},opts.animateTime);
					};
					opts.leftoneTime = opts.leftTwoTime;
				});
				function partCom(){
					$this.find('li.con').eq(0).stop(true,true).animate({'margin-left':'-'+opts.liWidth},opts.animateTime,function(){
						$(this).css('margin-left','0px');
						$this.append($(this));
					});
				};
				if(opts.autoplay){
					function autoPlay(){
						clearInterval(opts.timer);
						opts.timer = setInterval(function(){ partCom(); },opts.setIntervalTime);
					};
					autoPlay();			
					function clearIntervalFun(clearIntervalObj){
						$(clearIntervalObj).live('mouseover',function(){ clearInterval(opts.timer); });
						$(clearIntervalObj).live('mouseout',function(){	autoPlay();	});
					};
					clearIntervalFun($this);
					clearIntervalFun($thisAll);
					clearIntervalFun(opts.leftBut);
					clearIntervalFun(opts.rightBut);
				};
			};
		},
		'LeftRightClickChange':function(options){
            var opts = $.extend({},LeftRightClickChange_defaluts,options);
            var $this  = $(this);            
			$thisAll = $this.find('*');
			$LeftRightClickChangeButRight = $(opts.LeftRightClickChangeButRight);
			$LeftRightClickChangeButLeft = $(opts.LeftRightClickChangeButLeft);
			$LeftRightClickChangeButRightAll = $(opts.LeftRightClickChangeButRight).find('*');
			$LeftRightClickChangeButLeftAll = $(opts.LeftRightClickChangeButLeft).find('*');			
			opts.liSize = $this.find('li.con').size();
			opts.liWidth = $this.find('li.con').outerWidth(true);
			opts.leftOldTime = new Date();
			opts.rightOldTime = new Date();
			$this.find('li.con').live(opts.effect,function(){
				opts.liIndex = $(this).index();
				partCom();
			});
			$LeftRightClickChangeButRight.bind('click',function(){
				opts.rightNewTime = new Date();
				opts.betweenRightTime = opts.rightNewTime - opts.rightOldTime;				
				if(opts.setClickBetweenTime){
					if(opts.betweenRightTime>=opts.clickBetweenTime){						
						clickAdd();
					};
				}else{
					if(opts.betweenRightTime>=opts.animateTime){
						clickAdd();
					};
				};
				opts.rightOldTime = opts.rightNewTime;
			});
			$LeftRightClickChangeButLeft.live('click',function(){				
				opts.leftNewTime = new Date();
				opts.betweenLeftTime = opts.leftNewTime - opts.leftOldTime;
				if(opts.setClickBetweenTime){					
					if(opts.betweenLeftTime>=opts.clickBetweenTime){					
						LeftPartCom();
					};					
				}else{					
					if(opts.betweenLeftTime>=opts.animateTime){					
						LeftPartCom();
					};
				};
				function LeftPartCom(){
					opts.liIndex--;
					opts.onClickLeftFunction();
					if(opts.liIndex >= 0){
						if(opts.liIndex < (opts.liSize-opts.showSum)){
							opts.liLeft = -opts.liIndex*opts.liWidth+'px';
							$this.stop(true,true).animate({'left':opts.liLeft},opts.animateTime);
						};
					}else{
						opts.liIndex = (opts.liSize-1);
						opts.liLeft = -(opts.liIndex-(opts.showSum-1))*opts.liWidth+'px';
						$this.stop(true,true).animate({'left':opts.liLeft},opts.animateTime);
					};
					partCom();
				};
				opts.leftOldTime = opts.leftNewTime;
			});
			if(opts.autoPlay){
				function autoPlay(){
					clearInterval(opts.timer);
					opts.timer = setInterval(function(){clickAdd();},opts.setIntervalTime);
				};
				autoPlay();
				function clearIntervalFun(cleatIntervalObj){
					$(cleatIntervalObj).live('mouseover',function(){clearInterval(opts.timer);});
					$(cleatIntervalObj).live('mouseout',function(){autoPlay();});
				};
				clearIntervalFun($this);
				clearIntervalFun($thisAll);
				clearIntervalFun($LeftRightClickChangeButRight);
				clearIntervalFun($LeftRightClickChangeButLeft);
				clearIntervalFun($LeftRightClickChangeButRightAll);
				clearIntervalFun($LeftRightClickChangeButLeftAll);
			};
			function clickAdd(){
				opts.liIndex++;
				opts.onClickRightFunction();
				if(opts.liIndex <= opts.liSize-1){
					if(opts.liIndex>opts.showSum-1){
						opts.liLeft = '-'+(opts.liIndex-(opts.showSum-1))*opts.liWidth+'px';
						$this.stop(true,true).animate({'left':opts.liLeft},opts.animateTime);
					};
				}else{
					opts.liIndex = 0;
					opts.liLeft = '-'+(opts.liIndex)*opts.liWidth+'px';
					$this.stop(true,true).animate({'left':opts.liLeft},opts.animateTime);
				};				
				partCom();
			};
			function partCom(){
				$this.find('li').eq(opts.liIndex).addClass(opts.liHover).siblings('li').removeClass(opts.liHover);
			};
        },
		'randomChange':function(options){
			var opts = $.extend({},randomChange_defaluts,options);
			var $this  = $(this);
			$thisAll = $this.find('*');
			$thisButBox = $(opts.randomChangeBut);
			$thisButBoxAll = $thisButBox.find('*');
			$randomChangeLeftRightButLeft = $(opts.randomChangeLeftRightButLeft);
			$randomChangeLeftRightButRight = $(opts.randomChangeLeftRightButRight);
			opts.liWidth = $this.find('li').outerWidth(true);
			opts.liHeight = $this.find('li').outerHeight(true);
			opts.oldTime = new Date();
			opts.leftOldTime = new Date();
			opts.rightOldTime = new Date();
			var array = [
				{'top':'-'+opts.liHeight+'px'},
				{'left':''+opts.liWidth+'px'},
				{'top':''+opts.liHeight+'px'},
				{'left':'-'+opts.liWidth+'px'},
				{'top':'-'+opts.liHeight+'px','left':'-'+opts.liWidth+'px'},
				{'top':''+opts.liHeight+'px','left':''+opts.liWidth+'px'},
				{'top':''+opts.liHeight+'px','left':'-'+opts.liWidth+'px'},
				{'left':''+opts.liHeight+'px','top':'-'+opts.liWidth+'px'}
			];
			if(opts.fourDirection){
				var array = [
					{'top':'-'+opts.liHeight+'px'},
					{'left':''+opts.liWidth+'px'},
					{'top':''+opts.liHeight+'px'},
					{'left':'-'+opts.liWidth+'px'}
				];
			};
			if(opts.twoDirection){
				var array = [					
					{'left':'-'+opts.liWidth+'px'},
					{'left':''+opts.liWidth+'px'}
				];
				if(opts.ifupDownDirection){
					var array = [
						{'top':'-'+opts.liHeight+'px'},
						{'top':''+opts.liHeight+'px'}
					];
				};
			};
			$this.find('li.con:first').css({'z-index':'3'});
			opts.liSize = $this.find('li.con').size();
			for(var i=0; i<opts.liSize; ++i){opts.liStr += '<li></li>';};
			$thisButBox.html(opts.liStr);
			$thisButBox.find('li:first').addClass('liHover');
			$thisButBox.find('li').live('click',function(){					
				opts.newTime = new Date();
				opts.betweenTime = opts.newTime - opts.oldTime;
				if(opts.setClickBetweenTime){
					if(opts.betweenTime >= opts.clickBetweenTime){
						opts.liIndex = $(this).index();
						partCom();
					};
				}else{
					if(opts.betweenTime >= opts.animateTime){
						opts.liIndex = $(this).index();
						partCom();
					};
				};				
				opts.oldTime = opts.newTime;
			});
			$randomChangeLeftRightButRight.bind('click',function(){
				opts.rightNewTime = new Date();
				opts.betweenRightTime = opts.rightNewTime - opts.rightOldTime;
				if(opts.setClickBetweenTime){
					if(opts.betweenRightTime >= opts.clickBetweenTime){
						butRightPartCom();
					};
				}else{
					if(opts.betweenRightTime >= opts.animateTime){
						butRightPartCom();
					};
				};
				function butRightPartCom(){
					opts.liIndex++;
					opts.onClickRightFunction();
					opts.liIndex = opts.liIndex%opts.liSize;
					partCom();
				};					
				opts.rightOldTime = opts.rightNewTime;
			});
			$randomChangeLeftRightButLeft.bind('click',function(){					
				opts.leftNewTime = new Date();
				opts.betweenLeftTime = opts.leftNewTime - opts.leftOldTime;
				if(opts.setClickBetweenTime){
					if(opts.betweenLeftTime >= opts.clickBetweenTime){
						butLeftPartCom();
					};
				}else{
					if(opts.betweenLeftTime >= opts.animateTime){
						butLeftPartCom();
					};
				};
				function butLeftPartCom(){
					opts.liIndex--;
					opts.onClickLeftFunction();
					if(opts.liIndex == -1){opts.liIndex = opts.liSize-1};
					partCom();
				};					
				opts.leftOldTime = opts.leftNewTime;
			});
			if(opts.autoPlay){
				function autoPlay(){
					clearInterval(opts.timer);
					opts.timer = setInterval(function(){
						opts.liIndex++;
						opts.onClickRightFunction();
						opts.liIndex = opts.liIndex%opts.liSize; partCom();
					},opts.setInterValTime);
				};
				autoPlay();
				function clearIntervalFun(cleatIntervalObj){
					$(cleatIntervalObj).live('mouseover',function(){clearInterval(opts.timer);});
					$(cleatIntervalObj).live('mouseout',function(){autoPlay();});
				};
				clearIntervalFun($this);
				clearIntervalFun($thisAll);
				clearIntervalFun($thisButBox);
				clearIntervalFun($thisButBoxAll);
				clearIntervalFun($randomChangeLeftRightButRight);
				clearIntervalFun($randomChangeLeftRightButLeft);
			};
			function partCom(){
				opts.random = Math.floor(Math.random()*8);
				if(opts.fourDirection){opts.random = Math.floor(Math.random()*4);};
				if(opts.twoDirection){opts.random = Math.floor(Math.random()*2);};
				if(opts.oneDirection){opts.random = Math.floor(Math.random()*1);};
				$thisButBox.find('li').eq(opts.liIndex).addClass('liHover').siblings('li').removeClass('liHover');
				//opts.oFunction();
				$this.find('li.con').eq(opts.liClick).css({'z-index':'3'});
				$this.find('li.con').eq(opts.liIndex).css({'z-index':'2'});
				if(opts.liClick != opts.liIndex){
					$this.find('li.con').eq(opts.liClick).animate(array[opts.random],opts.animateTime,function(){
						$this.find('li.con').eq(opts.liClick).removeAttr("style");
						opts.liClick = opts.liIndex;
					});
				};
			};
		},
		'UpDownClickChange':function(options){
            var opts = $.extend({},UpDownClickChange_defaluts,options);
            var $this  = $(this);			
			$thisAll = $this.find('*');
			$UpDownClickChangeButRight = $(opts.UpDownClickChangeButRight);
			$UpDownClickChangeButLeft = $(opts.UpDownClickChangeButLeft);
			$UpDownClickChangeButRightAll = $(opts.UpDownClickChangeButRight).find('*');			
			$UpDownClickChangeButLeftAll = $(opts.UpDownClickChangeButLeft).find('*');
			opts.liSize = $this.find('li.con').size();
			opts.liHeight = $this.find('li.con').outerHeight(true);
			opts.leftOldTime = new Date();
			opts.rightOldTime = new Date();			
			$this.find('li.con').bind(opts.effect,function(){
				opts.liIndex = $(this).index();
				partCom();
			});
			if(opts.UpDownClickChangeButLeftRight){				
				$UpDownClickChangeButLeft.bind('click',function(){					
					opts.leftNewTime = new Date();
					opts.betweenLeftTime = opts.leftNewTime - opts.leftOldTime;					
					if(opts.setClickBetweenTime){
						if(opts.betweenLeftTime>=opts.clickBetweenTime){							
							LeftPartCom();
						};
					}else{
						if(opts.betweenLeftTime>=opts.animateTime){					
							LeftPartCom();
						};
					};
					function LeftPartCom(){
						opts.liIndex--;						
						opts.onClickLeftFunction();
						if(opts.liIndex >= 0){
							if(opts.liIndex < (opts.liSize-opts.showSum)){
								opts.liTop = -opts.liIndex*opts.liHeight+'px';
								$this.animate({'top':opts.liTop},opts.animateTime);
							};
						}else{							
							opts.liIndex = (opts.liSize-1);
							opts.liTop = -(opts.liIndex-(opts.showSum-1))*opts.liHeight+'px';
							$this.animate({'top':opts.liTop},opts.animateTime);
						};
						partCom();
					};					
					opts.leftOldTime = opts.leftNewTime; 
				});
				$UpDownClickChangeButRight.live('click',function(){					
					opts.rightNewTime = new Date();
					opts.betweenRightTime = opts.rightNewTime - opts.rightOldTime;
					if(opts.setClickBetweenTime){
						if(opts.betweenRightTime>=opts.clickBetweenTime){
							clickAdd();
						};
					}else{
						if(opts.betweenRightTime>=opts.animateTime){
							clickAdd();
						};
					};
					opts.rightOldTime = opts.rightNewTime;
				});
			};
			if(opts.autoPlay){
				function autoPlay(){
					clearInterval(opts.timer);
					opts.timer = setInterval(function(){clickAdd();},opts.setIntervalTime);
				};
				autoPlay();
				function clearIntervalFun(cleatIntervalObj){
					$(cleatIntervalObj).live('mouseover',function(){clearInterval(opts.timer);});
					$(cleatIntervalObj).live('mouseout',function(){autoPlay();});
				};
				clearIntervalFun($this);
				clearIntervalFun($thisAll);
				clearIntervalFun($UpDownClickChangeButRight);
				clearIntervalFun($UpDownClickChangeButLeft);
				clearIntervalFun($UpDownClickChangeButRightAll);
				clearIntervalFun($UpDownClickChangeButLeftAll);
			};
			function clickAdd(){
				opts.liIndex++;
				opts.onClickRightFunction();
				if(opts.liIndex <= opts.liSize-1){
					if(opts.liIndex>opts.showSum-1){
						opts.liTop = -(opts.liIndex-(opts.showSum-1))*opts.liHeight+'px';
						$this.animate({'top':opts.liTop},opts.animateTime);
					};
				}else{
					opts.liIndex = 0;
					opts.liTop = -(opts.liIndex)*opts.liHeight+'px';
					$this.animate({'top':opts.liTop},opts.animateTime);
				};
				partCom();
			};
			function partCom(){
				$this.find('li').eq(opts.liIndex).addClass(opts.liHover).siblings('li').removeClass(opts.liHover);
			};	
        },
		'TopBotInfiniterScroll':function(options){
			var opts = $.extend({},TopBotInfiniterScroll_Defaluts,options);
			var $this = $(this);
			var $thisAll = $(this).find('*');
			opts.Size = $this.find('li.con').size();			
			if(opts.Size>opts.ShowSum){
				opts.LiHeight = $this.find('li.con').outerHeight(true);			
				$(opts.scrollTopButTop).click(function(){opts.OnOff = true;});
				$(opts.scrollTopButBot).click(function(){opts.OnOff = false;});
				if(opts.OnOff){
					partComOne();
					opts.Top = -opts.LiHeight+'px';
					partCom();
				}else{
					opts.Top = 0+'px';
					partCom();
				};
				if(opts.autoPlay){
					function autoPlay(){		
						clearInterval(opts.Timer);
						opts.Timer = setInterval(function(){
							opts.Click++;
							if(opts.Click == opts.LiHeight){
								if(opts.OnOff){
									partComOne();
								}else{
									opts.FirstLi = $this.find('li.con').eq(0);
									$this.append(opts.FirstLi);
								};
								opts.Top = 0+'px';
								partCom();
								opts.Click = 0;
							};
							if(opts.OnOff){
								opts.Top = opts.Click - opts.LiHeight+'px';
							}else{
								opts.Top = '-'+opts.Click+'px';
							};
							partCom();
						},opts.setInterValTime);
					};
					autoPlay();					
					function clearIntervalFun(clearIntervalObj){
						$(clearIntervalObj).mouseover(function(){
							clearInterval(opts.Timer);
						});
						$(clearIntervalObj).mouseout(function(){
							autoPlay();
						});
					};
					clearIntervalFun($this);
				};
				function partCom(){
					$this.css('top',opts.Top);
				};
				function partComOne(){
					opts.LastLi = $this.find('li.con').eq(opts.Size-1);
					$this.prepend(opts.LastLi);
				};
			};
		},
		'Accordion':function(options){
            var opts = $.extend({},Accordion_defaluts,options);
            var $this  = $(this);
			var $thisAll = $(this).find('*');
			opts.size = $this.find('li.con').size();
			if(opts.size>1){
				for(var i=0; i<opts.size; ++i){
					Accordionclass = 'Accordionclass' + i;
					$this.find('li.con').eq(i).addClass(Accordionclass);
					$this.find('li.con').eq(i).attr('index',i);
				};
				for(var j=0; j<opts.size; ++j){
					$this.find('li.Accordionclass'+j).click(function(){
						opts.index = $(this).attr('index');
						partcom();
					});
				};
				if(opts.autoplay){
					function autoplay(){
						clearInterval(opts.timer);
						opts.timer = setInterval(function(){
							opts.index++;
							if(opts.index == opts.size){opts.index = 0;};
							partcom();
						},opts.setInterValTime);
					};
					autoplay();			
					function clearIntervalFun(clearIntervalObj){
						$(clearIntervalObj).bind('mouseover',function(){
							clearInterval(opts.timer);
						});
						$(clearIntervalObj).bind('mouseout',function(){
							autoplay();
						});
					};
					clearIntervalFun($this);
					clearIntervalFun($thisAll);					
				};
				function partcom(){
					$this.find('li.Accordionclass'+opts.index).find('h3').stop(true,true).slideUp();
					$this.find('li.Accordionclass'+opts.index).find('div.Accordion').stop(true,true).slideDown();
					$this.find('li.Accordionclass'+opts.index).siblings('li.con').find('h3').stop(true,true).slideDown();
					$this.find('li.Accordionclass'+opts.index).siblings('li.con').find('div.Accordion').stop(true,true).slideUp();
				};
			};
        },
		'rightFloat':function(options){
			var opts = $.extend({},RightFloat_Defaluts,options);
			var tips = $(this);
			opts.oTipsHeight = tips.height();
			opts.old = opts.theTop;
			moveTips();
			function moveTips(){
				var tt = 50;
				if(window.innerHeight>(opts.oTipsHeight+opts.theTop)){
					tips.css('position','absolute');			
					if(window.innerHeight){
						opts.pos = window.pageYOffset
					}else if (document.documentElement && document.documentElement.scrollTop){
						opts.pos = document.documentElement.scrollTop;
					}else if (document.body) {
						opts.pos = document.body.scrollTop;
					};
					opts.pos = opts.pos - tips.offset().top + opts.theTop;
					opts.pos = tips.offset().top + opts.pos/10;
					if(opts.pos < opts.theTop){opts.pos = opts.theTop;};
					if(opts.pos != opts.old){tips.css('top',opts.pos+'px'); tt = 10;}
					opts.old = opts.pos;
				}else{
					tips.css('position','fixed');
					tips.css('top',opts.overflowTop+'px');
				};
				setTimeout(moveTips,tt);
			};
		},
		'clickBackTop':function(options){
			var opts = $.extend({},clickBackTop_Defaluts,options);
			var $this = $(this);
			$(window).scroll(function(){
				opts.scrollTop = document.body.scrollTop||document.documentElement.scrollTop;
				$this.live('click',function(){
					clearInterval(opts.timer);
					opts.timer = setInterval(function(){
						opts.scrollTop = opts.scrollTop - opts.Dstance;
						if(opts.scrollTop <= 0){clearInterval(opts.timer);};
						if(document.body.scrollTop){
							document.body.scrollTop = opts.scrollTop;
						}else if(document.documentElement.scrollTop){
							document.documentElement.scrollTop = opts.scrollTop;
						};
					},opts.setIntervalTime);
				});
			});
		},
		'infeedAccordion':function(options){
            var opts = $.extend({},infeedAccordion_defaluts,options);
            var $this  = $(this);
			var $thisAll = $(this).find('*');
			opts.liWidth = $this.find('li.con').width();
			opts.liSize = $this.find('li.con').size();
			$this.find('li.con').each(function(index){				
				if($(this).hasClass(opts.liHover)){
					opts.liIndex = index;
				};
				opts.liArray.push($(this).width());
			});
			opts.liMaxWidth = Math.max.apply(Math,opts.liArray);
			opts.liMinWidth = Math.min.apply(Math,opts.liArray);
            $this.find('li.con').bind(opts.effect,function(){
				opts.liIndex = $(this).index();
				if($(this).width() != opts.liMaxWidth){
					partCom(opts.liIndex);
				};
			});
			if(opts.autoPlay){
				function autoPlay(){
					clearInterval(opts.timer);
					opts.timer = setInterval(function(){
						opts.liIndex++;
						opts.liIndex = opts.liIndex%opts.liSize;
						partCom(opts.liIndex);
					},opts.setIntervalTime);
				};
				autoPlay();
				function clearIntervalFun(cleatIntervalObj){
					$(cleatIntervalObj).bind('mouseover',function(){
						clearInterval(opts.timer);
					});
					$(cleatIntervalObj).bind('mouseout',function(){
						autoPlay();
					});
				};
				clearIntervalFun($this);
				clearIntervalFun($thisAll);
			};
			function partCom(){
				opts.onClickFunction();
				$this.find('li.con').eq(opts.liIndex).stop(true).animate({width:opts.liMaxWidth+'px'},opts.animateTime).siblings().stop(true).animate({width:opts.liMinWidth+'px'},opts.animateTime);
			};			
        },
		'verticalAccordion':function(options){
            var opts = $.extend({},verticalAccordion_defaluts,options);
            var $this  = $(this);
			var $thisAll = $(this).find('*');
			opts.liHeight = $this.find('li.con').height();
			opts.liSize = $this.find('li.con').size();
			$this.find('li.con').each(function(index){				
				if($(this).hasClass(opts.liHover)){
					opts.liIndex = index;
				};
				opts.liArray.push($(this).height());
			});
			opts.liMaxHeight = Math.max.apply(Math,opts.liArray);
			opts.liMinHeight = Math.min.apply(Math,opts.liArray);
            $this.find('li.con').bind(opts.effect,function(){
				opts.liIndex = $(this).index();
				if($(this).height() != opts.liMaxHeight){
					partCom(opts.liIndex);
				};
			});
			if(opts.autoPlay){
				function autoPlay(){
					clearInterval(opts.timer);
					opts.timer = setInterval(function(){
						opts.liIndex++;
						opts.liIndex = opts.liIndex%opts.liSize;
						partCom(opts.liIndex);
					},opts.setIntervalTime);
				};
				autoPlay();
				function clearIntervalFun(cleatIntervalObj){
					$(cleatIntervalObj).bind('mouseover',function(){
						clearInterval(opts.timer);
					});
					$(cleatIntervalObj).bind('mouseout',function(){
						autoPlay();
					});
				};
				clearIntervalFun($this);
				clearIntervalFun($thisAll);
			};
			function partCom(){
				opts.onClickFunction();
				$this.find('li.con').eq(opts.liIndex).stop(true).animate({height:opts.liMaxHeight+'px'},opts.animateTime).siblings().stop(true).animate({height:opts.liMinHeight+'px'},opts.animateTime);
			};			
        },
		'leftRightTabChange':function(options){
			var opts = $.extend({},leftRightTabChange_defaluts,options);
			var $this  = $(this);
			var $thisAll = $this.find('*');
			var $leftRightTabChangeListBut = $(opts.leftRightTabChangeListBut);
			var $leftRightTabChangeListButAll = $(opts.leftRightTabChangeListBut).find('*');
			var $leftRightTabChangeLeft = $(opts.leftBut);
			var $leftRightTabChangeRight = $(opts.rightBut);
			opts.liSize = $this.find('li.con').size();
			opts.liWidth = $this.find('li.con').outerWidth(true);
			opts.liHeight = $this.find('li.con').outerHeight(true);
			opts.rightOneDate = new Date();
			opts.leftOneDate = new Date();
			if(opts.leftRightChange){
				$this.css('width','1000%');
				$this.find('li.con').css('float','left');
			};
			$(opts.rightBut).live('click',function(){
				opts.rightOneTime = new Date();
				opts.rightBetweenTime = opts.rightOneTime - opts.rightOneDate;
				if(opts.setClickBetweenTime){
					if(opts.rightBetweenTime >= opts.clickBetweenTime){
						indexAdd();
					};
				}else{
					if(opts.rightBetweenTime >= opts.animateTime){
						indexAdd();
					};
				};
				opts.rightOneDate = opts.rightOneTime;
			});
			$(opts.leftBut).live('click',function(){
				opts.leftoneTime = new Date();
				opts.leftBetweenTime = opts.leftoneTime - opts.leftOneDate;
				if(opts.setClickBetweenTime){
					if(opts.leftBetweenTime >= opts.clickBetweenTime){
						opts.liIndex --;
						if(opts.liIndex == -1){opts.liIndex = opts.liSize-1};
						comPart(opts.liIndex);
					};
				}else{
					if(opts.leftBetweenTime >= opts.animateTime){
						opts.liIndex --;
						if(opts.liIndex == -1){opts.liIndex = opts.liSize-1};
						comPart(opts.liIndex);
					};
				};
				opts.leftOneDate = opts.leftoneTime;
			});
			$(opts.leftRightTabChangeListBut).find('a.con').live('click',function(){
				opts.liIndex = $(this).index();
				comPart(opts.liIndex);
			});
			if(opts.autoPlay){
				function autoPlay(){
					clearInterval(opts.timer);
					opts.timer = setInterval(function(){
						indexAdd();
					},opts.setIntervalTime);
				};
				autoPlay();
				function clearIntervalFun(clearIntervalObj){
					$(clearIntervalObj).mouseover(function(){clearInterval(opts.timer);});
					$(clearIntervalObj).mouseout(function(){autoPlay();});
				};
				clearIntervalFun($this);
				clearIntervalFun($thisAll);
				clearIntervalFun($leftRightTabChangeListBut);
				clearIntervalFun($leftRightTabChangeListButAll);
				clearIntervalFun($leftRightTabChangeLeft);
				clearIntervalFun($leftRightTabChangeRight);
			};
			function indexAdd(){
				opts.liIndex ++;
				opts.onClickRightFunction();
				opts.liIndex = opts.liIndex%opts.liSize;
				comPart(opts.liIndex);
			};			
			function comPart(){
				opts.onClickLeftFunction();
				if(opts.leftRightChange){
					opts.liLeft = '-' + opts.liIndex * opts.liWidth;
					$this.stop(true).animate({'left':opts.liLeft},opts.animateTime);
				}else{
					opts.liTop = '-' + opts.liIndex * opts.liHeight;
					$this.stop(true).animate({'top':opts.liTop},opts.animateTime);
				};
			};
		}
	});
	var InfiniterScroll_Defaluts = {
		click:0,
		liSize:'',
		showSum:5,
		IntervalTime:15,
		timer:null,
		left:'',
		ulLi:'',
		liWidth:200
	};
	var bannerChange_Defaluts = {
		autoPlay:true,
		liSize:'',
		index:0,
		Str:'',
		timer:null,
		fadeInTime:'2000',
		fadeOutTime:'1000',
		setInterValTime:'3000',
		ulBannerBut:'ul.bannerBut',
		bannerButHover:'bannerButHover',
		ifLeftRightClick:true,
		butRight:'span.butRight',
		butLeft:'span.butLeft',
	};
	var singleLeftRightChange_defaluts = {
		liSize:'',
		liWidth:'',
		timer:null,
		showsum:5,
		autoplay:true,
		animateTime:1000,
		setIntervalTime:2000,
		rightOneDate:0,
		rightoneTime:0,
		rightTwoDate:0,
		rightTwoTime:0,
		RightAfterBeforTime:0,
		leftOneDate:0,
		leftoneTime:0,
		leftTwoDate:0,
		leftTwoTime:0,
		leftAfterBeforTime:0,
		liLastChild:'',
		leftBut:'',
		rightBut:''
	};
	var LeftRightClickChange_defaluts = {
		liSize:'',
		liWidth:'',
		liIndex:'',		
		liLeft:'',
		liHover:'liHover',
		leftOldTime:'',
		leftNewTime:'',
		rightOldTime:'',
		rightNewTime:'',
		betweenLeftTime:'',
		betweenRightTime:'',
		effect:'click',
		autoPlay:true,
		setClickBetweenTime:true,
		clickBetweenTime:0,
		animateTime:500,
		setIntervalTime:1500,
		timer:null,
		showSum:4,
		LeftRightClickChangeButRight:'a.LeftRightClickChangeButRight',
		LeftRightClickChangeButLeft:'a.LeftRightClickChangeButLeft',
		onClickLeftFunction:function(){},
		onClickRightFunction:function(){}	
	};
	var randomChange_defaluts = {
		liSize:'',
		liIndex:'',
		liStr:'',
		liTop:'',
		liRight:'',
		liBottom:'',
		liLeft:'',
		oldTime:'',
		newTime:'',
		leftOldTime:'',
		leftNewTime:'',
		rightOldTime:'',
		rightNewTime:'',			
		betweenTime:'',
		betweenLeftTime:'',
		betweenRightTime:'',
		timer:null,
		autoPlay:true,
		liWidth:'',
		liHeight:'',
		fourDirection:false,
		twoDirection:false,
		ifupDownDirection:false,
		oneDirection:false,
		animateTime:500,
		setInterValTime:2000,
		setClickBetweenTime:false,
		clickBetweenTime:100,
		random:'',
		liClick:0,			
		randomChangeBut:'ul.randomChangeBut',
		randomChangeLeftRightButLeft:'',
		randomChangeLeftRightButRight:'',
		onClickRightFunction:function(){},
		onClickLeftFunction:function(){},
		oFunction:function(){}
	};
	var UpDownClickChange_defaluts = {
		liSize:'',
		liWidth:'',
		liIndex:'',		
		liTop:'',
		leftOldTime:'',
		leftNewTime:'',
		liHover:'liHover',
		rightOldTime:'',
		rightNewTime:'',
		betweenLeftTime:'',
		betweenRightTime:'',
		autoPlay:true,
		effect:'hover',
		animateTime:500,
		setIntervalTime:1500,
		timer:null,
		showSum:4,
		UpDownClickChangeButLeftRight:true,
		UpDownClickChangeButRight:'a.UpDownClickChangeButRight',
		UpDownClickChangeButLeft:'a.UpDownClickChangeButLeft',
		setClickBetweenTime:true,
		clickBetweenTime:0,
		onClickLeftFunction:function(){},
		onClickRightFunction:function(){}
	};
	var TopBotInfiniterScroll_Defaluts = {
		Click:0,
		Top:0,
		ShowSum:5,
		setInterValTime:30,
		Size:'',
		LiHeight:'',
		FirstLi:'',
		LastLi:'',
		Timer:null,
		OnOff:false,
		autoPlay:true,
		scrollTopButTop:'',
		scrollTopButBot:''
	};
	var Accordion_defaluts = {
		trigger:'click',
		effect:'slide',
		autoplay:true,
		size:'',
		setInterValTime:1000,
		index:0,
		timer:null,
		Accordionclass:''
	};
	var RightFloat_Defaluts = {
		theTop:150,
		oTipsHeight:'',
		pos:'',
		overflowTop:50,
		tt:50
	};
	var clickBackTop_Defaluts = {
		scrollTop:'',
		Dstance:30,
		setIntervalTime:20,		
		timer:null,
	};
	var infeedAccordion_defaluts = {
		liWidth:'',
		liHover:'liHover',
		liHoverWidth:'',
		liArray:[],
		liMaxWidth:'',
		liMinWidth:'',
		liIndex:0,
		liSize:'',
		animateTime:500,
		setIntervalTime:2500,
		autoPlay:true,
		effect:'click',
		timer:null,
		onClickFunction:function(){}
	};
	var verticalAccordion_defaluts = {
		liHeight:'',
		liHover:'liHover',
		liHoverHeight:'',
		liArray:[],
		liMaxHeight:'',
		liMinHeight:'',
		liIndex:0,
		liSize:'',
		animateTime:500,
		setIntervalTime:2500,
		autoPlay:true,
		effect:'click',
		timer:null,
		onClickFunction:function(){}
	};
	var leftRightTabChange_defaluts = {
		liSize:'',
		liWidth:'',
		liIndex:'',
		liLeft:'',
		liTop:'',
		liHeight:'',
		leftRightChange:true,
		timer:null,
		autoplay:true,
		animateTime:1000,
		setIntervalTime:2000,
		rightOneDate:0,
		rightOneTime:0,
		rightBetweenTime:0,
		setClickBetweenTime:true,
		clickBetweenTime:'800',
		leftOneDate:0,
		leftOneTime:0,
		leftBetweenTime:0,
		leftRightTabChangeListBut:'',
		leftBut:'',
		rightBut:'',
		onClickRightFunction:function(){},
		onClickLeftFunction:function(){}
	};
})(window.jQuery);
$.extend({
    myTime:{
        CurTime: function(){
            return Date.parse(new Date())/1000;
        },
        DateToUnix: function(string) {
            var f = string.split(' ', 2);
            var d = (f[0] ? f[0] : '').split('-', 3);
            var t = (f[1] ? f[1] : '').split(':', 3);
            return (new Date(
                parseInt(d[0], 10) || null,
                (parseInt(d[1], 10) || 1) - 1,
                parseInt(d[2], 10) || null,
                parseInt(t[0], 10) || null,
                parseInt(t[1], 10) || null,
                parseInt(t[2], 10) || null
                )).getTime() / 1000;
        },
        UnixToDate: function(unixTime, isFull, timeZone) {
            if (typeof (timeZone) == 'number'){
                unixTime = parseInt(unixTime) + parseInt(timeZone) * 60 * 60;
            }
            var time = new Date(unixTime * 1000);
            var ymdhis = "";
            ymdhis += time.getUTCFullYear() + "-";
            ymdhis += fullZero((time.getUTCMonth()+1)) + "-";
            ymdhis += time.getUTCDate();
            if (isFull === true){
                ymdhis += "" + time.getUTCHours() + ":";
                ymdhis += time.getUTCMinutes() + ":";
                ymdhis += time.getUTCSeconds();
            }
			function fullZero(mon){
				if(mon<10){
					var mon = "0"+mon;
				}
				return mon;
			}
            return ymdhis;
        }
    }
});


